using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace HamcoWcs.Entitys.WcsLocations
{
    public class WcsLocationConfig : IEntityTypeConfiguration<WcsLocation>
    {
        public void Configure(EntityTypeBuilder<WcsLocation> builder)
        {
            builder.HasComment("wcs货位表");
            builder.Property(x => x.Row).IsRequired().HasComment("排");
            builder.Property(x => x.Bay).IsRequired().HasComment("列");
            builder.Property(x => x.Lev).IsRequired().HasComment("层");
            builder.Property(x => x.Depth).IsRequired().HasDefaultValue(1).HasComment("深度");
            builder.Property(x => x.WmsLocName).IsRequired().HasMaxLength(30).HasComment("wms货位名");
            builder.Property(x => x.WcsLocName).IsRequired().HasMaxLength(30).HasComment("wcs货位名");
            builder.Property(x => x.SrmName).HasMaxLength(30).HasComment("堆垛机名");
            builder.Property(x => x.UnitId).HasMaxLength(60).HasComment("托盘号");
            builder.Property(x => x.LocStatus).HasDefaultValue(0).HasComment("货位状态，有货、无货、正在入库、正在出库");
            builder.Property(x => x.IsLock).HasDefaultValue(false).HasComment("是否锁定，true-锁定，false-释放");
            builder.Property(x => x.SrmOccupyFlag).HasComment("是否占用，true-占用，false-未占用");
            builder.Property(x => x.BasicShelf).HasDefaultValue(false).HasComment("是否为基准货位");
            builder.Property(x => x.LocType).HasMaxLength(30).HasComment("货位类型，SHELF | STATION");
            builder.Property(x => x.Aisle).IsRequired().HasMaxLength(30).HasComment("巷道号 CJSTW100 | CJSTW200");
            builder.Property(x => x.ZoneName).HasDefaultValue("").HasMaxLength(30).HasComment("Zone名称");
            builder.Property(x => x.WcsZone).HasDefaultValue("").HasMaxLength(50).HasComment("堆垛机双机模式运行划分区域");
            builder.Property(x => x.TeachInfo).HasDefaultValue("").HasColumnType("json").HasComment("teach数据");
            builder.Property(x => x.Remark).HasDefaultValue("").HasMaxLength(255).HasComment("备注 时间-用户-内容");
        }
    }
}